1. Technical Field
The invention relates to windowing toolkits for computers. More particularly, the invention relates to definition and manipulation of a focus owner within a focus traversal cycle.
2. Background Art
The basic functionality of a computer is dictated both by the hardware of the computer and by the type of operating system it uses. Various operating systems exist in the marketplace, including Solaris from Sun Microsystems, Mac OS from Apple Computer, the xe2x80x9cWindowsxe2x80x9d operating systems, e.g., Windows 95/98 and Windows NT, from Microsoft, and Linux. A given combination of computer hardware, an operating system 1 and a windowing system will be referred to herein as a xe2x80x9cplatformxe2x80x9d. Prior to the popularity of the Internet, software developers wrote programs specifically designed for individual platforms. Thus, a program written for one platform could not be run on another. However, the advent of the Internet made cross-platform compatibility a necessity.
Prior art FIG. 1 illustrates a conceptional arrangement wherein a first computer 3 running the Solaris platform and a second computer 5 running the Windows 98 platform are connected to a server 9 via the Internet 7. A resource provider using the server 9 might be any type of business, governmental, or educational institution. The resource provider has a need to be able to provide its resources to both the user of the Solaris platform and the user of the Windows 98 platform, but does not have the luxury of being able to custom design its content for the individual platforms.
The Java(trademark) programming language was developed by Sun Microsystems to address this problem. The Java(trademark) programming language was designed to be simple for the programmer to use, yet able to run securely over a network and work on a wide range of platforms.
Referring to FIG. 2, in order to create a Java(trademark) application, the developer first writes the application in human-readable Java(trademark) source code. As used herein, the term xe2x80x9capplicationxe2x80x9d refers to both true Java(trademark) applications and Java(trademark) xe2x80x9cappletsxe2x80x9d which are essentially small applications usually embedded in a web page. In the example shown, the application xe2x80x9cProgramxe2x80x9d 11 is created as a human-readable text file. The name of this text file is given the required extension xe2x80x9c.javaxe2x80x9d.
A Java(trademark) compiler such as Sun Microsystem""s xe2x80x9cjavacxe2x80x9d 13 is used to compile the source code into a machine-readable binary file 15. The text file will contain Java(trademark) language commands, e.g., xe2x80x9cimport java.awt.Framexe2x80x9d. A discussion of the Java(trademark) language itself is beyond the scope of this document. However, complete information regarding the Java(trademark) programming language is available from Sun Microsystems both in print and via the Internet. The resulting binary file 15 will automatically receive the same file name as the source text file, but will use xe2x80x9c.classxe2x80x9d as the trailing extension. The Java(trademark) runtime environment incorporates a Java(trademark) xe2x80x9cvirtual machinexe2x80x9d (JVM) 16 to convert the xe2x80x9c.classxe2x80x9d byte codes into actual machine executions 17. The machine executions (like drawing windows, buttons, and user prompt fields) will occur in accordance to the application developer""s code instructions. Because Sun Microsystems specifically designed the JVM to run on different platforms, a single set of xe2x80x9c.classxe2x80x9d byte codes will execute on any platform where a JVM has been installed. An Internet browser that incorporates a JVM, such as Netscape Navigator or Microsoft Internet Explorer, xe2x80x9cJava(trademark)-enabledxe2x80x9d browser.
The cross-platform architecture of the Java(trademark) programming language is illustrated in FIG 3, which shows how the Java(trademark) language enables cross-platform applications over the Internet. In the figure, the computer 3 running the Solaris platform and the computer 5 running the Windows 98 platform are each provided with a Java(trademark) virtual machine 21. The resource provider creates a Java(trademark) application using the Java(trademark) software development kit (xe2x80x9cSDKxe2x80x9d) 23 and makes the complied Java(trademark) byte codes available on the server 9, which in this example is running on a Windows NT platform. The server 9 may, but need not, be provided with its own JVM 21. Through standard Internet protocols, both the computer 3 and the computer 5 may obtain a copy of the same byte codes and, despite the difference in platforms, execute the byte codes through their respective JVMs.
FIG. 4 illustrates an exemplary display on a screen 31 including top-level windows 33, 34, and 35. Each window includes a title bar 37 for displaying the title of the window and, if applicable, a menu bar 39 containing a number of pull down menu buttons defined by the developer. In this example, window 34 is the xe2x80x9cactivexe2x80x9d window, as indicated by the darkened title bar. Windows 33 and 35 are inactive as indicated by the grayed out title bar. The window 33 includes a number of typical components, including xe2x80x9cradio buttonsxe2x80x9d 41 which in this case allow the user to select a prefix when check box 42 is checked, a text field 43 for entering a name, and an address field 45 for entering an address. Component 47 is a xe2x80x9cchooserxe2x80x9d allowing the user to choose a state. Components 49 are check boxes that allow the user to check one or all of the options that apply. Associated with these check boxes are additional radio buttons 51 and 53 that allow the user to select a desired means of transmission. If the xe2x80x9cquotexe2x80x9d check box 49 is selected and the telephone radio button is selected, the window 34 appears allowing the user to enter telephone numbers. An additional text area 57 is associated with the xe2x80x9cotherxe2x80x9d check box 49. Finally, xe2x80x9csubmitxe2x80x9d and xe2x80x9cresetxe2x80x9d buttons 59 are provided to allow the user to either submit the form or reset it.
Generally speaking, there is a particular look to the components of the type described above depending upon the type of platform being used. Thus, check boxes on the Solaris platform would appear different from check boxes on the Windows 98 platform. One of the early innovations of the Java(trademark) programming language was to allow cross-platform applicability while retaining the look and feel of the native platform on which the application was running. This was done by incorporating xe2x80x9cheavyweight componentsxe2x80x9d, namely, incorporating components from the native platform into the Java(trademark) application itself. This would ensure that a Java(trademark) application running on a particular platform would have a look and feel that was consistent with what th user, of that platform would expect. The Java(trademark) Abstract Windowing Toolkit or xe2x80x9cAWT,xe2x80x9d is a library of such heavyweight components for use by application developers.
As the popularity of the Internet has increased, users have become accustomed to many different types of interfaces. Thus, aesthetic conformity within a particular native platform has become less of an issue. At the same time, functionality, and versatility have become increasingly important. Particularly, developers now desire the flexibility to customize the appearance of a particular site to a company""s own look and feel. Therefore, the Java(trademark) 2 Standard Edition SDK includes a new package for the developer called the Java(trademark) Foundation Classes (also known as Swing). Swing is essentially a library of xe2x80x9clightweight componentsxe2x80x9d. Lightweight components are components that are not derived from a particular native platform. A primary motivation behind use of lightweight components is aesthetic conformity within a particular application. Swing components have xe2x80x9cpluggable look and feelxe2x80x9d, meaning that the developer can use them with their default appearance or define a different appearance for a particular application.
This new package of lightweight components is simply one library that is possible; other libraries may be created and in fact are available from third parties. Swing provides the developer with the option and flexibility to use lightweight components to customize appearance in a given application. A detailed discussion of the Java(trademark) AWT and the Swing package is beyond the scope of this document. Complete documentation is available from Sun Microsystems both in print and at the web site.
Another issue for consideration by the application developer is the concept of xe2x80x9cfocusxe2x80x9d. Traditionally, the xe2x80x9cfocus ownerxe2x80x9d is the component that, at a given time, receives keyboard input generated by the application user. The user, of course, has the ability to transfer focus between components. The primary method for changing focus is by clicking on a new component using a mouse. However, an alternate way of changing focus is by using the keyboard. Using the keyboard to change focus is referred to as xe2x80x9cfocus traversalxe2x80x9d. Typically, focus traversal is achieved using pre-defined keys on the keyboard (for example, the TAB key) or some equivalent device in an accessible environment. For example, referring again to FIG. 4, a cursor 61 (which would be blinking) is shown in the xe2x80x9chome phonexe2x80x9d text field 62. This means component 62 is the focus owner, and keyboard input generated by the user would be sent to that field. Typically, the user may then move to the next component (xe2x80x9ccell phonexe2x80x9d) without using the mouse by simply hitting the TAB key, or return to the previous component (xe2x80x9cwork numberxe2x80x9d) by hitting SHIFT-TAB. This is referred to as forward and backward focus traversal, respectively. In addition to user-initiated traversal, client code can also initiate traversal programmatically.
Existing programming toolkits, including the Java(trademark) AWT, employ focus traversal to assist and expedite application development. The existing focus traversal model in Swing defines a xe2x80x9cfocus cyclexe2x80x9d to be a set of components such that normal forward and backward focus traversal would be constrained to the components in the cycle. Each cycle defines a xe2x80x9cfocus cycle rootxe2x80x9d, which is a component in the hierarchy that contains all of the components in the focus cycle. These focus cycle roots are useful for efficiently specifying focus cycles.
For example, the developer can define a focus cycle to be all focus-traversable descendants of a focus cycle root. Returning to the example of FIG. 4, the window 33 may be defined as a focus cycle root to all the focus-traversable descendents shown inside that window. In responding to the example questionnaire, the application user would then be able to traverse through the various data-gathering components. Specifically, the focus cycle as shown in FIG. 5 results. Thus, the developer is able to establish a policy, e.g., of using the TAB and SHIFT-TAB keys, by which the user is able to reach all focusable components in the window using focus traversal.
In one aspect, the invention provides a method of establishing a focus traversal protocol in a graphical user interface having a plurality of components within at least one top-level window. The method includes defining the top-level window as a first focus cycle root, assigning a plurality of components to a first focus traversal cycle associated with the first focus cycle root, and for each component in the first focus traversal cycle, establishing a focus traversal key definition including a forward traversal key and a backward traversal key. The method further includes establishing a first focus traversal policy associated with the first focus traversal cycle.
In some embodiments, the invention includes defining one of the plurality of components of the first focus traversal cycle as a second focus cycle root, assigning a plurality of components to a second focus traversal cycle associated with the second focus cycle root, and for each component in the second focus traversal cycle, establishing a focus traversal key definition including a forward traversal key and a backward traversal key. The method further includes establishing a second focus traversal policy associated with the second focus traversal cycle.
In another aspect, the invention provides a windowing toolkit for use by a developer in establishing a focus traversal protocol for a graphical user interface having a plurality of components within at least one top-level window, the windowing toolkit having a plurality of windowing tools each having codes suitable to be executed by a computer. The toolkit includes a first tool configured to assign a plurality of components to a first focus traversal cycle associated with a first focus cycle root, the first focus cycle root being defined as a top-level window, a second tool configured to assign a focus traversal key definition to each component in the first focus traversal cycle, the focus traversal key definition including a forward traversal key and a backward traversal key, and a third tool configured to establish a first focus traversal policy associated with the first focus traversal cycle.
In some embodiments, the first tool is further configured to define one of the plurality of components of the first focus traversal cycle as a second focus cycle root and to assign a plurality of components to a second focus traversal cycle associated with the second focus cycle root. The second tool is further configured to assign a focus traversal key definition to each component in the second focus traversal cycle, the focus traversal key definition including a forward traversal key and a backward traversal key, and the third tool is further configured to establish a second focus traversal policy associated with the second focus traversal cycle.
Other aspects and advantages of the invention will be apparent from the following description and the appended claims.